<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Goods extends Model
{
	//商品表
    protected $table = 'shop_goods';

    public function brands()
    {
    	return $this->belongsTo('App\Model\Goodsbrand','brand_id');
    }


    public function types()
    {
    	return $this->belongsTo('App\Model\Goodstype','type_id');
    }

    public function sales()
    {
        return $this->belongsTo('App\Model\Goodssale', 'id', 'goods_id');
    }


    public function attrs()
    {
        return $this->hasMany('App\Model\Goodsattr');
    }

    public function specs()
    {
        return $this->hasOne('App\Model\Goodsspecs');
    }

}
